package com.sz.biz.logistics.ord.dto;

import io.swagger.annotations.ApiModelProperty;

import java.io.Serializable;
import java.math.BigDecimal;

/**
 * Function: 产品的订单的商品明细Dto <br>
 * Author: hpeng.wang <br>
 * Date: 2017-03-31 09:50:00
 */
public class OrdOrderCargoDto implements Serializable {
    /**
     * 自增长id
     */
    @ApiModelProperty(hidden = true)
    private Integer id;
    /**
     * 商品的中文名称
     */
    private String goodsNameCn;

    /**
     * 商品的英文名称
     */
    private String goodsNameEn;

    /**
     * 商品的数量
     */
    private Integer goodsNumber;
    /**
     * 商品的单位,从sys_dict表中找catalog为biz.unit.base，例如：件、条、个、辆
     */
    private String goodsUnit;
    private String goodsUnitName;

    /**
     * 商品的价格
     */
    private BigDecimal goodsPrice;

    /**
     * 海关编码
     */
    private String hsCode;
    private String description;

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public String getGoodsNameCn() {
        return goodsNameCn;
    }

    public void setGoodsNameCn(String goodsNameCn) {
        this.goodsNameCn = goodsNameCn;
    }

    public String getGoodsNameEn() {
        return goodsNameEn;
    }

    public void setGoodsNameEn(String goodsNameEn) {
        this.goodsNameEn = goodsNameEn;
    }

    public Integer getGoodsNumber() {
        return goodsNumber;
    }

    public void setGoodsNumber(Integer goodsNumber) {
        this.goodsNumber = goodsNumber;
    }

    public String getGoodsUnit() {
        return goodsUnit;
    }

    public void setGoodsUnit(String goodsUnit) {
        this.goodsUnit = goodsUnit;
    }

    public String getGoodsUnitName() {
        return goodsUnitName;
    }

    public void setGoodsUnitName(String goodsUnitName) {
        this.goodsUnitName = goodsUnitName;
    }

    public BigDecimal getGoodsPrice() {
        return goodsPrice;
    }

    public void setGoodsPrice(BigDecimal goodsPrice) {
        this.goodsPrice = goodsPrice;
    }

    public String getHsCode() {
        return hsCode;
    }

    public void setHsCode(String hsCode) {
        this.hsCode = hsCode;
    }

    public String getDescription() {
        return description;
    }

    public void setDescription(String description) {
        this.description = description;
    }

    //重写货物的equals方法
    @Override
    public boolean equals(Object obj) {
        if (obj instanceof OrdOrderCargoDto) {
            OrdOrderCargoDto oc = (OrdOrderCargoDto) obj;
            if (!goodsNameCn.equals(oc.getGoodsNameCn()) || !goodsNameEn.equals(oc.getGoodsNameEn()) || goodsNumber.intValue() != oc.getGoodsNumber().intValue() ||
                    !goodsUnit.equals(oc.getGoodsUnit()) || !goodsUnitName.equals(oc.goodsUnitName) || goodsPrice.compareTo(oc.getGoodsPrice())!=0
                    || !hsCode.equals(oc.getHsCode()) || !description.equals(oc.getDescription())) {
                return false;
            }

        }
        return true;
       // return super.equals(obj);
    }

}